package ar.com.nexoweb.actualidadbasquet;

import java.util.Timer;
import java.util.TimerTask;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class SplashActivity extends Activity {

	private long splashDelay = 2000; //6 segundos

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_splash);
		
		TimerTask task = new TimerTask() {
		      @Override
		      public void run() {
		        Intent mainIntent = new Intent().setClass(SplashActivity.this, MenuPrincipalActivity.class);
		        mainIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
		        startActivity(mainIntent);
		        finish(); 
		      }
		    };

		    Timer timer = new Timer();
		    timer.schedule(task, splashDelay);//Pasado los 6 segundos dispara la tarea
		
//		ImageView imgSplash = (ImageView) findViewById(R.id.imgSplash);
//		imgSplash.setOnClickListener(new OnClickListener() {			
//			@Override
//			public void onClick(View v) {
//				Intent intent = new Intent();
//				intent.setClass(v.getContext(), RssReaderActivity.class);
//				startActivity(intent);
//			}
//		});
		
	}

//	@Override
//	public boolean onCreateOptionsMenu(Menu menu) {
//		// Inflate the menu; this adds items to the action bar if it is present.
//		getMenuInflater().inflate(R.menu.splash, menu);
//		return true;
//	}

}
